<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
     <!-- step 1：引入 Vue.js 框架 -->
     <script src="https://labfile.oss.aliyuncs.com/courses/9775/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="pro in arrays">{{pro}}
                输入值：{{inputVal}}
            </li>
        </ul>
        <input type="text" placeholder="请输入要添加的项目" v-model="inputVal">
        <button @click="arrays.push(inputVal)">添加</button>


        <div v-for="info of person">{{info}}</div>
        <div v-for="(a,i,index) of person">{{i}}--{{a}}--{{index}}</div>
    </div>

    <table border="1">
        <tr>
            <td>姓名</td>
            <td>年龄</td>
            <td>性别</td>
        </tr>

    </table>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    inputVal:"",
                    arrays:["HTML","Python","Vue","CSS","Java"],
                    person:{
                        name:"张三",
                        age:19,
                        sex:'男'
                    },
                    persons:[{name:"张三",age:19,sex:"男"},
                    {name:"李四",age:19,sex:"女"},
                    {name:"王五",age:20,sex:"男"}]
                }
            },
        });
        app.mount("#app");
    </script>
</body>
</html>